package nina.yiyou.salary.output.util

class KeyPrefixPrepender {

  KeyPrefixPrepender(Map<String, ?> map, String prefix) {
    _map = map
    _prefix = prefix
  }

  Map<String, ?> prepend() {
    return _map.collectEntries { k, v -> ["${_prefix}.${k}".toString(), v] } as Map<String, ?>
  }

  private final Map<String, ?> _map

  private final String _prefix
}
